<template>
  <div class="Work">
      <top-header :isLeft="true" title="我的作品"></top-header>
      <li>
      <div class="mywork" v-for="(item, index) in share" :key="index">
          <div class="user_title">
              <img :src="item.icon2" alt="">
          <div class="p_title" style="margin-left:10px">
              <p>{{item.nickname}}</p>
              <p> {{item.time}} </p>
              </div></div>
          <div class="imgs">
            <p style="font-size:18px">{{item.contents}}</p>
            <div class="pic">
              <img :src="item.img" alt=""></div>
              </div>
 
      </div> <hr></li>
  </div>
</template>

<script>
import TopHeader from '../components/TopHeader.vue'
import QS from 'qs'
export default {
  components: { TopHeader },
    data() {
        return {
            share:'',
            
        }
    },
    methods: {
          getshare(){
              let params = {
                  id:localStorage.id
              }
      this.$ajax.post('http://localhost/mysql/shareselect2.php',QS.stringify(params))
      .then((res)=>{
        console.log(res.data)
          this.share = res.data
       
         
      })
      },
    },
      created() {
    this.getshare();
  },
}

</script>
<style lang="scss" scoped>
    .mywork{
        margin-top: 80px;
        .user_title{
            display: flex;
            img{
                width: 80px;
                height: 80px;
                border-radius: 50%;
            }
            .p_title{
                padding-top: 20px;
            }
        }
        .imgs{
            margin:10px 10px 10px 10px;
            .pic{
                text-align: center;
            }
            img{
               
                width: 300px;
                height: 250px;
            }
            p{
                text-indent: 30px;
            }
        }
    }
  
</style>